using Microsoft.AspNetCore.Builder;
using hao_Common.Logging.Middleware;

namespace hao_Common.Logging.Extensions
{
    /// <summary>
    /// 应用程序构建器扩展方法
    /// </summary>
    public static class ApplicationBuilderExtensions
    {
        /// <summary>
        /// 使用请求日志中间件
        /// </summary>
        /// <param name="app">应用程序构建器</param>
        /// <returns></returns>
        public static IApplicationBuilder UseRequestLogging(this IApplicationBuilder app)
        {
            return app.UseMiddleware<RequestLoggingMiddleware>();
        }
    }
}